import KZJRequest from '../index'
import { TRequestDefaultResult } from '../type'

enum MyMusic {
  Down = '/song/download/url', // 下载歌曲
  Like = '/like'
}

export function getDownMusic(id: number, br?: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: MyMusic.Down,
    params: { id, br },
    showLoading: true
  })
}

export function putLikeMusic(id: number, like?: boolean) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: MyMusic.Like,
    params: { id, like },
    showLoading: true,
    takeCookie: true,
    immediately: true
  })
}
